import {EntityId, PageQueryParams} from "kf-web-library";
import {Journal, JournalPeriod, JournalSubscribePlan, PayOrder, User} from "@/services";

export interface JournalSubscribePageQueryParams extends Partial<PageQueryParams> {
  searchText?: string;
  ids?: EntityId[];
}

export interface JournalSubscribe{
  id: number; //主键
  displayType: string; //订阅呈现类型
  timeType: string; //订阅时间类型
  user: User; //用户
  order: PayOrder; //订单
  journal: Journal; //期刊
  plan: JournalSubscribePlan; //订阅套餐
  periodCount: number; //包含期数（冗余）
  periodIds: number[]; //刊期ID集合
  periodList: JournalPeriod[]; //已交付刊期集合
  periodListCount: number; //已交付刊期数量
  subscribeDate: string; //订阅日期
  status: string; //订阅状态(有效,已用完/过期)
  isAutoRenew: boolean; //是否自动续订(1:是,0:否)
  seq: number; //排序
  createTime: string; //创建时间
  createUserId: number; //${column.comment}
  modifyTime: string; //修改时间
  modifyUserId: number; //${column.comment}

  shippingCount: number; //已发送期数
}



export interface JournalSubscribe_Create{
  userId: number; //用户ID
  orderId: number; //订单ID
  journalId: string; //期刊ID
  planId: number; //订阅套餐ID
  subscribeDate: string; //订阅日期
  status: string; //订阅状态(有效,已用完/过期) SubscribeStatus
  isAutoRenew: boolean; //是否自动续订(1:是,0:否)
  seq: number; //排序
}



export interface JournalSubscribe_Modify extends JournalSubscribe_Create {
  id: EntityId;
}

export interface JournalSubscribe_Patch extends Partial<JournalSubscribe_Modify> {
  id: EntityId;
}

